# 题1: 检测一个密码里必须包含至少一个大写 至少一个小写至少一个特殊字符(.!@#$/), 长度至少8位.
import re

passwd_list = [
    'Aa1234567.',
    'AA1234567!',
    'aa1234567',
    '123456789',
    'Cc1234567',
    'abcdefghijk',
    'Abcdefghijk',
]
# ^(?=.*?[a-z])
for passwd in passwd_list:
    regex = re.search(r'^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?[\.!@#\$/]).{8,}', passwd)
    if regex:
        pass
        # print(regex.group())
    else:
        pass
        # print(f'密码不合法:{passwd}')

# 题2: 去标签.

# 题3: 面试题.


def replace_sub(match_obj):
    tag = match_obj.group(1)
    if 'sub' in tag or 'sup' in tag:
        return tag


text1 = '<a>1111111</a><sub>000000<div>aaaa</div></sub><img>2222222</img><sup>88888888<div>aaaa</div></sup>'
# test_string = "<a>测试</a><sub>测试测试</sub><sup>测试测试测试</sup><div>测试测</div><img>testtesttest</img>"
